<!--
  @author heguanghua
  @since 2020/04/23 10:01
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasDetail=${#authPermit.checkPermit('/permit/detail.action')},
     hasList=${#authPermit.checkPermit('/permit/list.action')},
     hasRoleList=${#authPermit.checkPermit('/permit/role/list.action')},
     hasAddEdit=${#authPermit.checkPermit('/permit/modify/addEdit.action')},
     hasModifyStatus=${#authPermit.checkPermit('/permit/modify/modifyStatus.action')},
     hasModifySort=${#authPermit.checkPermit('/permit/modify/modifySort.action')}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/permit/list.action|">权限管理</a>
        <th:block th:if="${sys.sysId != null}">&nbsp;>&nbsp;</th:block>
        <a th:lay-href="|${SYS_MCC}/sys/detail.action?sysId=${sys.sysId}|" lay-text="系统信息" th:text="${sys.sysName}" th:if="${sys.sysId != null}">sysName</a>
        <th:block th:if="${module.moduleId != null}">&nbsp;>&nbsp;</th:block>
        <a th:lay-href="|${SYS_MCC}/module/detail.action?moduleId=${module.moduleId}|" lay-text="模块信息" th:text="${module.moduleName}" th:if="${module.moduleId != null}">moduleName</a>
    </blockquote>

    <div class="layui-card">
        <form method="POST" class="layui-form" action="/permit/list.action">
            <div th:replace="permit/_query::query"></div>
        </form>

        <div class="layui-card-body">
            <div th:replace="permit/_table::table"></div>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group" th:if="${hasModifyStatus}">
                        <button class="layui-btn layui-btn-sm" lay-event="start">启用</button>
                        <button class="layui-btn layui-btn-sm" lay-event="stop">停用</button>
                    </div>
                    <div class="layui-btn-group" th:if="${module != null && module.moduleId != null && hasAddEdit}">
                        <a th:lay-href="|${SYS_MCC}/permit/detail.action?moduleId=${module.moduleId}|" class="layui-btn layui-btn-sm layui-btn-primary" lay-text="权限信息" text="新增权限">+新增权限</a>
                    </div>
                </div>
            </script>
        </div>
    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">
    var json = {
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        status:[[${vo.status}]]
    };

    layui.extend({
        permit_list: "permit/zmn.permit.list"
    }).use(['index', 'permit_list']);
</script>
